/**
 * Created by baiguiren on 1/16/17.
 */

const async = require('async');

const test_arr = ['awk', 'sed', 'lua'];
const pl_map = {
    'awk': [1, 2, 3],
    'sed': ['haha', 'hehe'],
    'lua': ['awks', 'rubys']
};

// async.concat(test_arr, (item, callback)=> {
//     setTimeout(()=>{
//         console.log('finish ' + item);
//         callback(null, pl_map[item]);
//     }, Math.random()*100);
// }, (err, results)=>{
//     console.log(results);
// });
//

async.concatSeries(test_arr, (item, callback)=>{
   setTimeout(()=>{
       console.log('finish ' + item);
       callback(null, pl_map[item]);
   }, Math.random() * 100);
}, (err, results)=>{
    console.log(results);
});